home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / TCP⁄PPP⁄SLIP / TCP⁄IP Scripting Addition 1.1.2 / Examples 1.2 / READ ME SAMPLE CODE (text) < prev    next >
Text File  |  1994-10-13  |  7KB  |  80 lines

  1. TCP/IP Sample Programs
  2. Copyright © 1994 by Atul Butte. All Rights Reserved.
  3.  
  4. There are nine sample programs included with this 1.1.2 release of the TCP/IP Scripting Addition.  All require the TCP/IP Scripting Addition 1.1.2. All are Copyright (c) 1994 Atul Butte, All rights reserved. You may look at these sample programs and write your own based on these.  Some of the sample programs (those written with Script Editor) are provided as both compiled and text files (to ease compatibility with AppleScript 1.0). The FrontMost applications are saved as "complete applications," so you don't need the FrontMost/FaceSpan extension in your Extensions folder to run them.
  5.  
  6. If you have any questions, comments or suggestions, please mail me at atul_butte@brown.edu
  7.  
  8.  
  9. Script Editor FTP Clients
  10.  
  11. 1. Drag and Drop FTP
  12.  
  13. Launch this application by itself, then enter the destination host, your account name on that host, the destination directory on that host in which to store the files, then the type of file transfer you would like (MacBinary, Text, or raw Binary). After the application quits, drag any files onto the application. Enter your password and the files will be transferred to the destination host using the FTP protocol.
  14.  
  15. To change the destination host and account name or any of the other initial information, launch the application again by itself.
  16.  
  17. DON'T DRAG FOLDERS ONTO THE APPLICATION!
  18.  
  19. Suggestions: You could modify the script to use the Password OSAX to hide the password as it is typed. You could also add it to OSA Menu and, using the Scriptable Finder, modify it so that the user could click on a file in the Finder, then choose the script to send that file. You could also make it support sending folders (making new directories on the host, then sending the files and folders in that directory, etc).
  20.  
  21. 2. Run and Get FTP
  22.  
  23. Launch this application by itself and enter the FTP host, your user-id on that host, the source directory on that host in which to find the files, the type of file transfer you would like (MacBinary, Text, or raw Binary), and into which directory on your Macintosh you would like the files downloaded. Finally, enter your password and the files will be transferred from the destination host using the FTP protocol.
  24.  
  25. Suggestions: Use the Password OSAX to hide the password.
  26.  
  27. FrontMost FTP Clients
  28.  
  29. 3. Drag and Drop FTP
  30.  
  31. This application is similar to the Script Editor Drag and Drop FTP described above, except it uses a FrontMost (i.e. FaceSpan) interface to set the file transfer parameters and it uses a progress bar to detail its progress.
  32.  
  33. 4. Run and Get FTP
  34.  
  35. This application is similar to the Script Editor Run and Get FTP described above, except it uses a FrontMost (i.e. FaceSpan) interface to set the file transfer parameters and it uses a progress bar to detail its progress. Again, DON'T DRAG FOLDERS ONTO THE APPLICATION!
  36.  
  37. Other Samples
  38.  
  39. 5. Baby Telnet
  40.  
  41. Run this application and enter the hostname to which you would like to Telnet. Then enter the type of terminal you would like to emulate (I suggest sticking to VT100, but if you change this, enter it in all caps). After a few moments (during which the script handles Telnet Options Negotiations), Scriptable Text Editor will open and you will be presented with the login message. This script will prompt you with a ">" prompt. Type your text after the ">" and press return at the end of the line. Everything the host sends to you will be surrounded by bracket characters ("[" and "]").
  42.  
  43. After you are done logging off the host, type stop at the ">" prompt and the program will stop.
  44.  
  45. Note: even though you will be emulating a VT100, you will be entering text in a sort of linemode (since the script doesn't send anything you typed until you press return). The host will first echo the characters you sent before sending other output. Also note that the VT100 commands (clear screen, position the cursor, etc) are not supported.
  46.  
  47. Suggestions: Use this script as a first step to building your own automated login scripts.
  48.  
  49. 6. Finger
  50.  
  51. Launch this application, then enter a internet host name and account to check. This program will use the Finger protocol to get more information about that account (like last login time, office phone number, etc). The results are placed in a new Scriptable Text Editor window.
  52.  
  53. 6. FrontMost Finger Client
  54.  
  55. This program is similar to the previous one, but uses a FrontMost interface.
  56.  
  57. 7. Send Mail
  58.  
  59. Run this script, then enter your e-mail host, account, and a subject line when prompted. This program will send a simple message to that account, using the SMTP protocol.
  60.  
  61. Suggestions: Modify this script to send the contents of the clipboard, then add it to the Apple Menu or OSA Menu.
  62.  
  63. 8. Gopher Server
  64.  
  65. Drag this application to a folder containing text files, then launch the application. The text files in its folder (and those in any subfolder) will be made available through Gopher. Use Gopher to connect to your Macintosh at port 70 (the default for Gopher) and start browsing.
  66.  
  67. You can even connect to this server from your own Macintosh (using TurboGopher, Sextant, etc).
  68.  
  69. Suggestions: You could add to this script to support GIF/JPEG graphics files, or even support the Gopher+ protocol.
  70.  
  71. 9. Gopher Client
  72.  
  73. Gopher Client is a Gopher browser (like TurboGopher, Sextant, etc). For full use, Gopher Client requires Scriptable Text Editor, JPEG View, the TCP/IP Scripting Addition (osax). Gopher Client is a basic implementation of a gopher client (just like TurboGopher).  However, it currently doesn't support searching, Mac files, sound files, movies, or anything other than folders, text files, and GIF files. The text files you read are limited to 32K (because the Gopher Client uses Scriptable Text Editor to show you the text).  This limitation may not present if you modify it to use another scriptable word processor.
  74.  
  75. One feature that Gopher Client has that TurboGopher doesn't is that you can select multiple items in a window, then double click on one to open all the selected items.
  76.  
  77. Currently, you can't close windows using the keyboard, and you can't open any arbitrary host (i.e. connect directly to another gopher server). Temporary files are created when a text or GIF file needs to be opened. These files are made in the invisible Temporary Items folder, inside the System Folder.  The Gopher Client does not delete these files, but when you reboot, they will automatically be placed in your Trash and should be deleted.
  78.  
  79. I'm sorry the Gopher Client is slow… it's working as fast as it can!
  80.